/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package atributosDef;

import java.util.ArrayList;
import tablaDeSimbolos.TablaDeSimbolos;

/**
 *
 * @author Prado
 */
public class AtributosDef {
    
    private TablaDeSimbolos ts;
    protected int etq;
    protected ArrayList<Instruccion> cod;
    private boolean[] errores;

    public AtributosDef(TablaDeSimbolos ts, int etq, ArrayList<Instruccion> cod, boolean[] errores) {
        this.ts = ts;
        this.etq = etq;
        this.cod = cod;
        this.errores = errores;
    }
    
    public AtributosDef(){
        
    }

    public TablaDeSimbolos getTs() {
        return ts;
    }

    public int getEtq() {
        return etq;
    }

    public ArrayList<Instruccion> getCod() {
        return cod;
    }

    public boolean[] getErrores() {
        return errores;
    }
    
    public boolean getErrorEnPosicion(int i){
        return errores[i];
    }
    
    public boolean hayErrores(){
        int i = 0;
        while(i<errores.length){
            if(errores[i]){
                return true;
            }else{
                i++;
            }
        }
        return false;
    }
    
    public void setErrores(boolean[] errores){
       this.errores = errores;
    }

    public void setErrores(int posicion, boolean valor){
       this.errores[posicion] = valor;
    }
}
